package trystero.lib.http;

import trystero.lib.http.POSTData;
import trystero.lib.http.Cookie;

import java.util.Hashtable;

public class HTTPRequestState
{
   String url;
   POSTData data;
   Cookie cookie;
   Hashtable headers;

   public String url() { return this.url; }
   public void url(String url) { this.url = url; }

   public POSTData data() { return this.data; }
   public void data(POSTData data) { this.data = data; }

   public Cookie cookie() { return this.cookie; }
   public void cookie(Cookie cookie) { this.cookie = cookie; }

   public Hashtable headers() { return headers; }

   public String header(String key) 
   { 
      if(headers == null)
	 return null;

      return (String)headers.get(key);
   }

   public void addHeader(String key, String value)
   {
      if(headers == null)
	 headers = new Hashtable();

      headers.put(key, value);
   }
}
